kpse_include ../../texk/make/common.mk
kpse_include ../../texk/make/programs.mk
kpse_include ../../texk/make/library.mk

ZLIBDIR=../zlib
ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)

LIBPNGDIR=../libpng
LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)

XDEFS = -DHAVE_LIBPNG @ZLIBCPPFLAGS@ @LIBPNGCPPFLAGS@

OBJS = gdcache.o gdfontg.o gdfontl.o gdfontmb.o gdfonts.o gdfontt.o gdft.o \
  gdfx.o gd_gd2.o gd_gd.o gd_gif_in.o gd_gif_out.o gdhelpers.o gd_io_dp.o \
  gd_io_file.o gd_io.o gd_io_ss.o gd_jpeg.o gdkanji.o gd.o gd_png.o \
  gd_ss.o gdtables.o gd_topal.o gd_wbmp.o gdxpm.o wbmp.o gd_security.o
all: libgd.a

libgd.a: $(OBJS)
	rm -f $@
	$(AR) $(ARFLAGS) $@ $(OBJS)
	$(RANLIB) $@

kpse_include ../../texk/make/clean.mk

clean::
	rm -f libgd.a

distclean:: clean
	rm -f config.h
